<template>
    <div class="body_background" :style="GetWindowBackground">
        <div class="body_background padding-top10 marBottom">
            <div class="block-box items-start">
                <div class="big-font-size three-color">发货信息</div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color">商品类型：</div>
                        <div class="big-font-size three-color">总部直供</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color">发货单号：</div>
                        <div class="big-font-size three-color">36564654645</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start order-list-box">
                <div class="big-font-size three-color">商品清单</div>
                <div class="order-list-item">
                    <div class="order-content-box" v-for="(item,index) in goodsList" :key="item.id">
                        <img :src="item.imgUrl"/>
                        <div class="order-info-box">
                            <div class="main-color big-font-size">商品名称</div>
                            <div class="goods-content">
                                <div>
                                    <div class="three-color small-font-size">订单号：1415</div>
                                    <div class="three-color small-font-size">退款数量：20</div>
                                </div>
                                <div class="price-color big-font-size goods-count">-￥200</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="block-box items-start marBottom">
                <div class="big-font-size main-color">退款原因</div>
                <textarea v-model="noteContent" class="note-content" placeholder="请输入退款原因"></textarea>
            </div>
        </div>
        <div class="body_background create-button-box">
            <mt-button class="width40 middle-font-size"
                       @click="cancelClickFun"
            >取消
            </mt-button>
            <mt-button class="width40 middle-font-size background white-color"
                       @click="createInventoryFun"
            >提交
            </mt-button>
        </div>
    </div>

</template>

<script>
    import {Toast} from 'mint-ui';

    export default {
        name: "GoodsRefundSub",
        data() {
            return {
                GetWindowBackground: {
                    'min-height': ''
                },
                noteContent:'',
                goodsList: [
                    {
                        id: 1,
                        title: "秘制小番茄500g",
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }, {
                        id: 2,
                        title: "秘制小番茄500g",
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    },{
                        id: 3,
                        title: "秘制小番茄500g",
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }, {
                        id: 4,
                        title: "秘制小番茄500g",
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ],
            }
        },
        methods: {

            //取消
            cancelClickFun() {
                // this.$router.go(-1);//返回上一层
                this.$router.push('/WarehoueCreate')
            },
            //提交
            createInventoryFun() {
                this.$router.push('/StockGoodsManage')
            },
            getHeight() {
                // 获取浏览器高度
                this.GetWindowBackground['min-height'] = window.innerHeight + 'px'
            },
        },
        // 生命周期 - 创建完成（可以访问当前this实例）
        created() {
            window.addEventListener('resize', this.getHeight) // 注册监听器
            this.getHeight() // 页面创建时先调用一次
        },
        // 生命周期 - 销毁完成
        destroyed() {
            window.removeEventListener('resize', this.getHeight)
        },
    }
</script>

<style lang="scss" scoped>

    .create-box {
        width: 100%;
        margin-top: 5px;
        li {
            width: 100%;
            height: 45px;
            display: flex;
            align-items: flex-end;
            div {
                margin-bottom: 7px;
            }
            input, select {
                width: calc(100% - 100px);
                height: 30px;
                border-top: 0;
                border-left: 0;
                border-right: 0;
                border-bottom: 1px solid #ebedf1;
                outline: none;
                list-style: none;
            }
        }
    }

    .add-inventory-box {
        width: 70%;
        height: 40px;
        line-height: 40px;
        background: #fff;
        border-radius: 6px;
        margin: auto;
        font-size: 14px;
        .padding-left {
            padding-left: 15px;
        }
    }
    .note-content{
        width: calc(100% - 20px);
        border-radius: 6px;
        border: 1px solid #eef0f3;
        margin-top: 5px;
        text-align: left;
        font-size: 13px;
        padding: 10px;
    }
    .order-list-box {
        margin: 10px auto;
        .order-list-item {
            width: 100%;
            background: #fff;
            margin-top: 10px;
            border-radius: 4px;
            .order-top-box {
                width: 100%;
                height: 35px;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            .order-content-box {
                width: 100%;
                display: flex;
                padding: 7px 0;
                img {
                    width: 60px;
                    height: 60px;
                    margin-right: 10px;
                    border-radius: 4px;
                }
                .goods-content {
                    width: 100%;
                    display: flex;
                    justify-content: space-between;
                }
                .order-info-box {
                    width: calc(100% - 70px);
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                    text-align: left;
                }
                .goods-count {
                    margin-left: auto;
                    margin-top: 10px;
                }
            }
        }
    }
    .marBottom {
        margin-bottom: 50px;
    }
    .create-button-box {
        width: 100%;
        height: 70px;
        position: fixed;
        bottom: 0px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        .width40 {
            width: 40%;
            border: 1px solid #05c569;
            color: #05c569;
            border-radius: 10px;
        }
    }

</style>